#include<iostream>



class Calculate
{
public:


   virtual int Add(int a,int b)
   {

        return a + b;                                       
   }

       virtual int Sub(int a,int b)
   {

        return a - b;                                       
   }
      
       virtual int Mul(int a,int b)
   {

        return a * b;                                       
   }
     
       virtual int Div(int a,int b)
   {
        return a / b;                                       
   }



};





// 想修改直接像下面一样就行

class ADD :public Calculate
{
int Add(int a,int b)
{
    return a + b;
}

};

class SUB :public Calculate
{
int Sub(int a,int b)
{
    return a - b;
}

};

class MUL :public Calculate
{
int Mul(int a,int b)
{
    return a * b ;
}

};

class DIV :public Calculate
{
int Div(int a,int b)
{   
    if(a == 0 && b==0)
    {   std::cout<<"除数和被除数有至少一个 为 0"<<std::endl;
        return 0;
    }
    
    return a / b;
}

};


int main()
{
    // Calculate point;
    // std::cout<<point.Add(2,3)<<std::endl;
    
    // Calculate* point = new ADD;
    // std::cout<<point->Add(2,3)<<std::endl;


    // Calculate point;
    // std::cout<<point.Sub(2,3)<<std::endl;
    
    // Calculate* point = new SUB;
    // std::cout<<point->Sub(2,3)<<std::endl;   
    
    return 0;
}